package part3.c17_null_object;

import java.util.Date;

/**
 *  专门为null分出一条“支线”
 *  @see #NULL
 */
public interface Employee {
    void pay();
    //假如是null则返回boolean(值得观察用boolean来写是否就是最好的)
    boolean isTimeToPay(Date datePay);
    //为了程序的可读性，建议加上修饰符
    public static final Employee NULL = new Employee() {
        public void pay() {
            //don't do anything
            System.out.println("oh! u should not pay for this");
        }
        public boolean isTimeToPay(Date datePay) {
            return false;
        }
    };
}
